
package com.zb.hms.business.aspect;


import java.lang.reflect.Method;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.stereotype.Component;

import com.zb.hms.base.util.dateUtil.DateFormat;

/**
 *
 * @Description
 * @author zb
 * @datetime 2017-8-19 14:14:42
 * @version V1.0
 */
@Component
@Aspect
public class GeneralAspect {  
		  @Pointcut("execution(* com.zb.hms..*ServiceInter.*(..))")
		  public void poincut(){      
		  								}
     @After(value = "poincut()")
     public void after(JoinPoint joinPoint){    	    	
    	 Signature signature=	joinPoint.getSignature();
    	 MethodSignature methodSignature = (MethodSignature) signature;  
    	 Method method = methodSignature.getMethod();  
//    	 Logger.getInstance(joinPoint.getTarget().getClass()).info(DateFormat.getTime(DateFormat.CHINA)+"执行-----------"+method+"-------------");
     }
     
     @AfterThrowing(pointcut = "poincut()",throwing = "e")
     public void arou(JoinPoint point,Exception e){
    	  System.out.println("log--------------"+e.getClass()+":"+e.getMessage()+"-------------");
//    	  Logger.getLogger(point.getTarget().getClass()).error(e.getMessage());
     }
}
